<script setup>
import { ref } from 'vue'
import FileSelect from '../components/FileSelect.vue'

let page = 'modifySize'
let suffix = ref('')
let imgwidth = ref('')
let imgheight = ref('')
let formatsAry = ['png', 'jpeg', 'jpg', 'webp']
</script>
<template>
  <div class="sets-wrapper">
    <h5>目标图片尺寸</h5>
    <div class="params-set">
      <div class="item-param">
        <van-field v-model="imgwidth" placeholder="图片的宽度（像素）" style="padding: 0" />
      </div>
      <div class="item-param">
        <van-field v-model="imgheight" placeholder="图片的高度（像素）" style="padding: 0" />
      </div>
      <div class="item-param">
        <h5>图片格式：</h5>
        <van-radio-group v-model="suffix" direction="horizontal">
          <van-radio name="" style="margin-bottom: 15px">original</van-radio>
          <van-radio
            :name="item"
            v-for="(item, index) in formatsAry"
            :key="index"
            style="margin-bottom: 15px"
            >{{ item }}
          </van-radio>
        </van-radio-group>
      </div>
    </div>
  </div>
  <div class="files-wrapper flex1">
    <FileSelect
      :page="page"
      :msg="suffix"
      :imgwidth="imgwidth"
      :imgheight="imgheight"
    />
  </div>
</template>
<style scoped>
.sets-wrapper {
  width: 35vw;
  padding: 10px 15px;
}

.item-param {
  border-bottom: 1px solid #ddd;
  padding: 20px 0;
}

.item-param h5 {
  margin-bottom: 10px;
}

.item-param.quality {
  padding: 10px 0 30px;
}

.item-param.quality h5 {
  margin-bottom: 20px;
}

.item-param input {
  border: 0;
}

.custom-button {
  width: 26px;
  color: #fff;
  font-size: 10px;
  line-height: 18px;
  text-align: center;
  background-color: #2f85da;
  border-radius: 100px;
}

.files-wrapper {
  background-color: #f5f5f5;
}
</style>
